﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JXC.Core.Models;
using JXC.Application.Dtos;

namespace JXC.WebAPI.Profiles
{
    public class ShopDtoProfile : Profile
    {
        public ShopDtoProfile()
        {
            CreateMap<CommodityInformationSheet, ShopDto>()
                .ForMember(opt=>opt.TypeName,dest=>dest.MapFrom(src=>src.GoodsType.TypeName))
                .ForMember(opt=>opt.CinfoName,dest=>dest.MapFrom(src=>src.Cinfo.WarehouseName));
            CreateMap<ShopDto, CommodityInformationSheet>();
        }

    }
}
